﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Benefit.Service.ServerData
{
    /// <summary>
    /// 结算历史表
    /// </summary>
    public class ServiceT_Settle_History : Benefit.Interface.ServerData.IT_Settle_History
    {
        Benefit.DB.DBManager db = null;
        public ServiceT_Settle_History(Benefit.DB.DBManager db)
        {
            this.db = db;
        }

        /// <summary>
        /// 查询某天最大的结算信息编号
        /// </summary>
        /// <param name="accountid"></param>
        /// <param name="tradingday"></param>
        /// <returns></returns>
        public int GetDayMaxSettlementInfoId(string tradingday)
        {
            DavidDB.ADO.DBManager dbmanager = new DavidDB.ADO.DBManager();
            string sql = "select max(SettlementId) from T_Settle_History where TradingDay='" + tradingday + "'";
            object obj = dbmanager.GetSingle(sql);
            int maxSettlementId = -1;
            if (obj != null)
            {
                maxSettlementId = Convert.ToInt32(obj);
            }
            dbmanager.Commit();
            dbmanager.Dispose();
            return maxSettlementId;
        }


    }
}